import { HttpGet, HttpPost } from '@/api/index.js'

/**
 * 新增
 * @param data
 */
export const add = (data) => {
    return HttpPost('/admin/system/organization/add', data)
}

/**
 * 编辑
 * @param data
 */
export const edit = (data) => {
    return HttpPost('/admin/system/organization/update', data)
}

/**
 * 根据父节点获取列表
 */
export const listByPid = (pid) => {
    return HttpGet('/admin/system/organization/listByPid', {pid})
}

//获取全部组织树结构
export const allTree = () => {
    return HttpGet('/admin/system/organization/allTree')
}

/**
 * 根据ID删除数据
 * @param id
 */
export const deleteById = (id) => {
    return HttpPost('/admin/system/organization/deleteById/' + id)
}